#!/bin/bash
 
# 备份原有的yum源配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
 
# 下载阿里云YUM源配置文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
 
# 清理缓存并更新yum
yum clean all
yum makecache
 
echo "阿里云YUM源配置完成。"